<template>
  <div>
    <h2>深入v-model</h2>

    <input type="text" v-model="msg" />
    <span>你好{{ msg }}</span>
    <br />
    <!-- v-model的本质 -->
    <input type="text" :value="msg" @input="msg = $event.target.value" />
    <span>你好{{ msg }}</span>

    <!-- <CustomInput :value="msg" @input="msg = $event"></CustomInput> -->
    <CustomInput v-model="msg"></CustomInput>
  </div>
</template>

<script type="text/ecmascript-6">
import CustomInput from "./CustomInput.vue";
export default {
  name: "ModelTest",
  data() {
    return {
      msg: "赵丽颖",
    };
  },
  components: {
    CustomInput,
  },
};
</script>
